package com.zpark.entity.patients;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 患者诊断记录表
 * @TableName western_diagnosis_records
 */
@TableName(value ="western_diagnosis_records")
@Data
public class WesternDiagnosisRecords implements Serializable {
    /**
     * 记录ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 患者ID
     */
    @TableField(value = "patient_id")
    private Long patientId;

    /**
     * 医院名称
     */
    @TableField(value = "hospital")
    private String hospital;

    /**
     * 科室名称
     */
    @TableField(value = "department")
    private String department;

    /**
     * 就诊类型(门诊/急诊/住院等)
     */
    @TableField(value = "visit_type")
    private String visitType;

    /**
     * 就诊时间
     */
    @TableField(value = "visit_time")
    private Date visitTime;

    /**
     * 主治医生
     */
    @TableField(value = "doctor")
    private String doctor;

    /**
     * 主诊断
     */
    @TableField(value = "main_diagnosis")
    private String mainDiagnosis;

    /**
     * 其他诊断(JSON数组格式)
     */
    @TableField(value = "secondary_diagnoses")
    private Object secondaryDiagnoses;

    /**
     * 治疗方案
     */
    @TableField(value = "treatment_plan")
    private String treatmentPlan;

    /**
     * 用药信息(JSON数组格式)
     */
    @TableField(value = "medications")
    private Object medications;

    /**
     * 医生备注
     */
    @TableField(value = "notes")
    private String notes;

    /**
     * 复诊建议
     */
    @TableField(value = "follow_up_advice")
    private String followUpAdvice;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WesternDiagnosisRecords other = (WesternDiagnosisRecords) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getHospital() == null ? other.getHospital() == null : this.getHospital().equals(other.getHospital()))
            && (this.getDepartment() == null ? other.getDepartment() == null : this.getDepartment().equals(other.getDepartment()))
            && (this.getVisitType() == null ? other.getVisitType() == null : this.getVisitType().equals(other.getVisitType()))
            && (this.getVisitTime() == null ? other.getVisitTime() == null : this.getVisitTime().equals(other.getVisitTime()))
            && (this.getDoctor() == null ? other.getDoctor() == null : this.getDoctor().equals(other.getDoctor()))
            && (this.getMainDiagnosis() == null ? other.getMainDiagnosis() == null : this.getMainDiagnosis().equals(other.getMainDiagnosis()))
            && (this.getSecondaryDiagnoses() == null ? other.getSecondaryDiagnoses() == null : this.getSecondaryDiagnoses().equals(other.getSecondaryDiagnoses()))
            && (this.getTreatmentPlan() == null ? other.getTreatmentPlan() == null : this.getTreatmentPlan().equals(other.getTreatmentPlan()))
            && (this.getMedications() == null ? other.getMedications() == null : this.getMedications().equals(other.getMedications()))
            && (this.getNotes() == null ? other.getNotes() == null : this.getNotes().equals(other.getNotes()))
            && (this.getFollowUpAdvice() == null ? other.getFollowUpAdvice() == null : this.getFollowUpAdvice().equals(other.getFollowUpAdvice()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getHospital() == null) ? 0 : getHospital().hashCode());
        result = prime * result + ((getDepartment() == null) ? 0 : getDepartment().hashCode());
        result = prime * result + ((getVisitType() == null) ? 0 : getVisitType().hashCode());
        result = prime * result + ((getVisitTime() == null) ? 0 : getVisitTime().hashCode());
        result = prime * result + ((getDoctor() == null) ? 0 : getDoctor().hashCode());
        result = prime * result + ((getMainDiagnosis() == null) ? 0 : getMainDiagnosis().hashCode());
        result = prime * result + ((getSecondaryDiagnoses() == null) ? 0 : getSecondaryDiagnoses().hashCode());
        result = prime * result + ((getTreatmentPlan() == null) ? 0 : getTreatmentPlan().hashCode());
        result = prime * result + ((getMedications() == null) ? 0 : getMedications().hashCode());
        result = prime * result + ((getNotes() == null) ? 0 : getNotes().hashCode());
        result = prime * result + ((getFollowUpAdvice() == null) ? 0 : getFollowUpAdvice().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", patientId=").append(patientId);
        sb.append(", hospital=").append(hospital);
        sb.append(", department=").append(department);
        sb.append(", visitType=").append(visitType);
        sb.append(", visitTime=").append(visitTime);
        sb.append(", doctor=").append(doctor);
        sb.append(", mainDiagnosis=").append(mainDiagnosis);
        sb.append(", secondaryDiagnoses=").append(secondaryDiagnoses);
        sb.append(", treatmentPlan=").append(treatmentPlan);
        sb.append(", medications=").append(medications);
        sb.append(", notes=").append(notes);
        sb.append(", followUpAdvice=").append(followUpAdvice);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}